import json
import os

from libs.utils import logging

# 日志打印数字
logging.info(12)

# 日志打印字符串
logging.info("hello world")

# 日志打印字典
logging.info({"name": "张三", "age": 18})

# 日志打印列表
logging.info([1, 2, 3, 4, 5])

# 日志打印元组
logging.info((1, 2, 3, 4, 5))

# 日志打印文件路径
logging.info(os.path.abspath(__file__))

# 日志打印两行==========
logging.info("'================================='")
logging.info("'================================='")

# 日志打印json字符串
json_data = {"name": "张三", "age": 18}
logging.info(json.dumps(json_data, indent=4, ensure_ascii=False))

# 日志打印复杂的json数据
json_data = {
    "name": "张三",
    "age": 18,
    "address": {
        "province": "北京",
        "city": "北京",
        "street": "东四环"
    },
    "hobbies": ["打篮球", "踢足球", "跑步"],
    "is_married": False
}
logging.info(json.dumps(json_data, indent=4, ensure_ascii=False))



# 关闭日志
logging.close()